home *** CD-ROM | disk | FTP | other *** search
-
- ; *** Lemmings Universal HD Loader V1.6
- ; *** Written by Jean-François Fabre
- ;
- ; *** a hell of a loader!!!!!!
-
- include "jst.i"
-
- HD_PARAMS "",0,0
-
- MAINBASE = $78A82
-
- VER_MORE_NTSC = 1
- VER_MORE_PAL = 2
- VER_2D_PAL = 3
- VER_2D_NTSC = 4
- VER_BUDGET = 5
- VER_MORE_KEI = 6
- VER_2D_TIMO = 7
-
-
- loader:
- RELOC_MOVEL D0,trainer
-
- Mac_printf "Lemmings Universal HD Loader V1.6"
- Mac_printf "Coded by Jean-François Fabre © 1997-2000"
- NEWLINE
- Mac_printf "Thanks to Keith Krellwitz, Dominic Cresswell,"
- Mac_printf "Troy Pladson, Jacob Jensen, Phil Douglas,"
- Mac_printf "Kristian Hesketh"
-
- RELOC_TSTL trainer
- beq trskip$
- NEWLINE
- Mac_printf "Infinite time activated"
- trskip$
-
- TESTFILE mainname
- tst.l D0
- bne MainErr
-
- move.l #2000,D0
- JSRABS LoadSmallFiles
-
- move.l #$80000,D0
- JSRABS AllocExtMem
- RELOC_MOVEL D0,ExtBase
- beq noext$
-
- RELOC_MOVEL #$80000,ExtSize
-
- move.l ExtBase(pc),D0
- cmp.l #$80000,D0
- beq onemegchip$
-
- RELOC_MOVEL #$00F,ExtFlag
- bra suite$
-
- onemegchip$
- RELOC_MOVEL #$F00,ExtFlag
- bra suite$
-
- ; *** only the 512K chipmem used
- noext$
- RELOC_CLRL ExtSize
- RELOC_CLRL ExtFlag
- RELOC_CLRL ExtBase
-
- suite$
-
- bsr GetVersion
-
- moveq.l #0,D0
- move.l #CACRF_CopyBack,D1
- JSRABS Degrade
-
- GO_SUPERVISOR
- SAVE_OSDATA $80000
-
- lea $DFF000,A6
- move.w #$7FFF,dmacon(A6)
- move.w #$7FFF,intena(A6)
-
- move.w #$FFFF,bltafwm(A6) ; set blitter masks to all ones
- move.w #$FFFF,bltalwm(A6) ; ""
-
- BootGame:
- move.l #MAINBASE,A1
- lea mainname(pc),a0
- moveq #0,D0
- moveq #-1,D1
- JSRGEN ReadFile
-
- bsr PatchMain
-
- JSRGEN FlushCachesHard
-
- move.l ExtBase(pc),4.W
- MOVE.L ExtSize(pc),8.W
- MOVE.l ExtFlag(pc),D2
-
- JMP MAINBASE+$4E
-
- PatchMain:
- move.l version(pc),D0
- cmp.l #VER_BUDGET,D0
- beq PatchMain_Budget
- cmp.l #VER_MORE_NTSC,D0
- beq PatchMain_MoreNTSC
- cmp.l #VER_2D_PAL,D0
- beq PatchMain_2DPAL
- cmp.l #VER_2D_TIMO,D0
- beq PatchMain_2DTIMO
-
- lea VerErr2(pc),A0
- JSRGEN SetExitRoutine
- JSRGEN InGameExit
- loop$
- move.w #$F00,$DFF180
- bra loop$
-
-
- PatchMain_Budget:
- ; *** removes country check (PAL/NTSC)
-
- move.l #$4E714E71,$2F2+MAINBASE
-
- ; *** disk routine
-
- PATCHUSRJMP $92A+MAINBASE,DiskRoutine
-
- ; *** main program
-
- PATCHUSRJMP $1C0+MAINBASE,PatchCode_Budget
- rts
-
- PatchMain_MoreNTSC:
- ; *** Adjusts PAL version to NTSC
-
- move.l #MAINBASE,A0
-
- cmp.w #$2C81,($A6,A0)
- beq ntscver$
-
- RELOC_MOVEL #VER_MORE_PAL,version
-
- move.w #$2C81,($A6,A0) ; patch from NTSC->PAL
- move.w #$F4C1,($AC,A0) ; so main files are identical
- move.l #$4E7560FE,($36A,A0)
-
- PATCHUSRJMP $22A+MAINBASE,PatchCode_MorePAL
-
-
- bra cont$
- ntscver$
- ; *** main program
-
- PATCHUSRJMP $22A+MAINBASE,PatchCode_MoreNTSC
-
- cont$
- ; *** it can be the DOS version. Be careful
-
- cmp.w #$00C0,($238,A0)
- bne protected$
-
- ; *** it is the DOS version
-
- RELOC_MOVEL #VER_MORE_KEI,version
-
- PATCHUSRJMP $9DC+MAINBASE,DiskRoutine
-
- ; *** removes country check (PAL/NTSC)
-
- move.w #$4E75,$362+MAINBASE
-
- rts
-
- protected$
-
- ; *** removes country check (PAL/NTSC)
-
- move.l #$4E714E71,$362+MAINBASE
-
-
- ; *** disk routine
-
- PATCHUSRJMP $9E2+MAINBASE,DiskRoutine
-
- rts
-
- PatchMain_2DPAL:
- ; *** correct NTSC version to PAL
-
- lea MAINBASE,A0
- move.l #$4E754E75,($792,A0) ; remove country check
-
-
- cmp.w #$3D7C,($464,A0)
- beq palver$
-
- RELOC_MOVEL #VER_2D_NTSC,version
-
- move.l #$3D7C4681,($464,A0)
- move.w #$0EC1,($46C,A0)
- move.w #$4681,($3B1A,A0)
- move.w #$0EC1,($3B20,A0)
-
- palver$
- ; *** Main prog, common to both PAL and NTSC versions
-
- PATCHUSRJMP $3BCC+MAINBASE,PatchCode_2D
- PATCHUSRJMP $3C0A+MAINBASE,PatchCode_2D_Dec
-
- ; *** Decrunch
-
- PATCHUSRJMP $8AA+MAINBASE,Decrunch
-
- ; *** Country check
-
- ; move.l #$4E714E71,$78A+MAINBASE
-
- ; *** Disk loading routine
-
- PATCHUSRJMP $6B14+MAINBASE,DiskRoutine
-
- ; *** Pre intro patch (useless...)
-
- ; PATCHUSRJSR $7907E,PatchIntro
- ; PATCH_NOP $7907E+6
- rts
-
- IFD BLITTERFIX
- PatchIntro:
- JSRGEN FlushCachesHard
- btst #6,$BFE001
- rts
-
- BlitterFix:
- STORE_REGS
- lea MAINBASE,A0
- lea $7FFF0,A1
- lea .waitblit_str(pc),A2
- move.l #8,D0
- .loop:
- JSRGEN HexSearch
- cmp.l #0,A0
- beq.b .end
-
- ; changes blitwait routine
-
- PATCHGENJSR (A0),WaitBlit
- PATCH_NOP (6,A0)
- bra.b .loop
- .end
- RESTORE_REGS
- rts
-
- .waitblit_str:
- dc.l $082E0006,$000266F8
- ENDC
-
- PatchMain_2DTIMO:
- lea MAINBASE,A0
- move.l #$4E754E75,($792,A0) ; remove country check
-
-
- PATCHUSRJMP $3BCC+MAINBASE,PatchCode_2DTIMO
- PATCHUSRJMP $3C0A+MAINBASE,PatchCode_2DTIMO_Dec
-
- ; *** Disk loading routine
-
- PATCHUSRJMP $6B14+MAINBASE,DiskRoutine
- rts
-
- PatchCode_Budget:
- STORE_REGS
- MOVE #$7FFF,154(A6) ; original game
- PATCHUSRJMP $7F32.W,DiskRoutine
-
- ; *** removes disk protection (motherfuckers)
-
- PATCHUSRJMP $7592.W,RemoveProtect_Budget
-
- ; *** install quit key
-
- PATCHUSRJSR $1762.W,kbint_Budget
- move.w #$4E71,$1768.W
-
- ; *** remove f***ing checksum codes
-
- bsr RemoveChecksums
- bsr RemoveChecksums_Budget
-
- ; *** trainer?
-
- move.l trainer(pc),d0
- beq notrain$
-
- move.b #$4A,$1952.W
- notrain$
-
- RESTORE_REGS
- jmp $400.W
-
- ; actually there are 2 PAL versions: one standalone with password
- ; and another one very similar to NTSC version. We have to check the
- ; code before patching
-
- PatchCode_MorePAL:
- ; *** check if this is the diskcheck version
-
- cmp.l #$3D7C8210,$75D2.W
- beq PatchCode_MoreNTSC ; PAL version, but same code as NTSC
-
- ; ok password PAL version
-
- ; *** trainer
-
- RELOC_TSTL trainer
- beq notrain$
-
- move.w #$6010,$197C.W
- notrain$
-
- ; *** the keyboard interrupt
-
- PATCHUSRJSR $177C.W,kbint_Common
-
- ; *** the disk routine
-
- PATCHUSRJMP $815C,DiskRoutine
-
- ; *** remove password protection
-
- move.b #$60,$3058.W
- move.b #$60,$30FC.W
-
- JSRGEN FlushCachesHard
-
- lea $DFF000,A6
- move.w #$7FFF,dmacon(A6)
- move.w #$7FFF,intena(A6)
-
- jmp $400.W
-
-
- PatchCode_MoreNTSC:
- ; *** trainer
-
- move.l D0,-(sp)
- move.l trainer(pc),d0
- beq notrain$
-
- move.w #$6010,$197A.W
- notrain$
- move.l (sp)+,D0
-
-
- PATCHUSRJMP $7F72.W,DiskRoutine
-
- PATCHUSRJMP $75D2.W,RemoveProtect_MoreNTSC
- move.w #$4E75,$3CC2.W
-
- PATCHUSRJSR $177A.W,kbint_Common
- move.w #$4E71,$1780.W
-
- JSRGEN FlushCachesHard
-
- lea $DFF000,A6
- move.w #$7FFF,dmacon(A6)
- move.w #$7FFF,intena(A6)
-
- jmp $400.W
-
- RemoveProtect_MoreNTSC:
- move.l #$1001ff00,$8464
- move.l #$70616e65,$9cf8
- move.l #$00075578,$9d2c
- move.l #$0000017d,$9e08
- move.l #$e8ad0000,$9e20
- move.l #$0000017d,$9e34
- move.l #$3e030000,$9e50
- move.l #$00010003,$cd68
- move.l #$00200033,$14078
- rts
-
- ; *** keyboard patch (quit) for oh no more lemmings version
-
- kbint_Trainer:
- cmp.b #$46,D0
- bne kbint_Common
-
- move.w $9E5A,$9DBE ; number of lemmings saved=maximum number
-
- move.b #$45,D0 ; simulates ESC
-
- kbint_Common:
- move.b #0,$BFEC01
- cmp.b #$59,D0
- bne noquit$
- JSRGEN InGameExit
- noquit$
- rts
-
- ; *** keyboard patch (quit) for budget version
-
- kbint_Budget:
- move.b #1,$BFEC01
- cmp.b #$59,D0
- bne noquit$
- JSRGEN InGameExit
- noquit$
- rts
-
- PatchCode_2DTIMO_Dec:
- bsr Decrunch ; decrunch (original program)
- PatchCode_2DTIMO:
- ; *** remove protection
-
- PATCHUSRJMP $7638.W,RemoveProtect_2DTIMO
-
- bra PatchCode_2D_Common
-
- PatchCode_2D_Dec:
- JSR $7932C ; decrunch (original program)
- PatchCode_2D:
-
- ; *** remove protection
-
- PATCHUSRJMP $7638.W,RemoveProtect_2D
-
- PatchCode_2D_Common:
-
- ; *** the trainer (infinite time)
-
- move.l D0,-(sp)
- move.l trainer(pc),d0
- beq notrain$
-
- move.w #$6010,$1952.W
- notrain$
- move.l (sp)+,D0
-
- ; *** remove f***ing checksum codes
-
- bsr RemoveChecksums
- bsr RemoveChecksums_2D
-
- ; *** the keyboard interrupt
-
- PATCHUSRJSR $1752.W,kbint_Trainer
-
- ; *** the disk routine
-
- PATCHUSRJMP $7FD8.W,DiskRoutine
-
- ; *** flushes caches
-
- JSRGEN FlushCachesHard
-
- lea $DFF000,A6
- move.w #$7FFF,dmacon(A6)
- move.w #$7FFF,intena(A6)
-
- jmp $400.W
-
-
- RemoveChecksums:
-
- PATCH_NOPNOP $30CA.W
- PATCH_NOP $30CE.W
-
- PATCH_NOPNOP $3B52.W
- PATCH_NOP $3B56.W
-
- PATCH_NOPNOP $16D6
- PATCH_NOP $16DA
-
- PATCH_NOP $1F18
-
- rts
-
- RemoveChecksums_2D:
- ; those ones were added for v1.4
- ; after having examined the Phil Douglas
- ; SKID ROW cracked version (thanks to him)
-
- PATCH_NOPNOP $3FCE
- PATCH_NOPNOP $455C
- PATCH_NOPNOP $4F08
- PATCH_NOPNOP $6EB4
- PATCH_NOPNOP $6ECE
-
- rts
-
- RemoveChecksums_Budget:
- ; those ones were added for v1.4
- ; after having examined the Phil Douglas
- ; SKID ROW cracked version (thanks to him)
- ; and adapted to the offset changes recently
-
- PATCH_NOPNOP $3F28
- PATCH_NOPNOP $44B6
- PATCH_NOPNOP $4E62
- PATCH_NOPNOP $6E0E
- PATCH_NOPNOP $6E28
- rts
-
-
- RemoveProtect_2D_Common:
- move.l #$0,$8
- move.l #$7efa,$c
- move.l #$34c,$10 ; <-- added
- ; move.l #$682fa0e6,$14
- move.l #$330,$24 ; <-- added
- move.l #$8290ffc1,$60
- move.l #$fff8,$264
- move.l #$fff8,$268
- move.l #$594000cf,$26c
- move.l #$b0,$270
- move.l #$1498,$274
- move.l #$1914,$278
- move.l #$7a498b40,$27c
- move.l #$442,$280
- move.l #$1,$28c
- move.l #$800002,$290
- move.l #$3,$298
- move.l #$fff8,$29c
- move.l #$594000cf,$2a0
- move.l #$b0,$2a4
- move.l #$1498,$2a8
- move.l #$1914,$2ac
- move.l #$970f8d2c,$2b0
- move.l #$a,$2b4
- move.l #$2,$2c0
- move.l #$800002,$2c4
- move.l #$8290ffc1,$2c8 ; important
- move.l #$3,$2cc
- move.l #$7b76,$2d0
- move.l #$dff000,$2d4
- move.l #$2d8,$2d8
- move.l #$7e2a,$2dc
- move.l #$2f3bb76e,$2e0
- move.l #$2c6f42b2,$2e4
- move.l #$7a46,$2e8
- move.l #$21000000,$2ec
- move.l #$360006c,$2f0
- move.l #$e1687,$2f4
- move.l #$8290ffc1,$2f8 ; important
- move.l #$7e5c,$2fc
- move.l #$a7080000,$300
- move.l #$7ab02024,$304
- move.l #$7aae,$308
- move.l #$2f3c9dfa,$30c
- move.l #$8290ffc1,$310 ; imp
- move.l #$1875a,$314
- move.l #$a7040000,$318
- move.l #$9250,$31c
- move.l #$34c,$320
- move.l #$a7000000,$324
- move.l #$7fae2024,$328
- move.l #$7fa8,$32c
- move.l #$bd96bdae,$330
- move.l #$4487a,$334
- move.l #$1423df,$338
- move.l #$10,$33c
- move.l #$4dfaffee,$340
- move.l #$202e00b8,$344
- move.l #$4e7b0002,$348
- move.l #$200a6720,$34c
- move.l #$b3c86f0c,$350
- move.l #$d1c0d3c0,$354
- move.l #$23205980,$358
- move.l #$66fa6006,$35c
- move.l #$22d85980,$360
- move.l #$66fa200b,$364
- move.l #$67064299,$368
- move.l #$598066fa,$36c
- move.l #$2d4c00be,$370
- move.l #$4fee007c,$374
- move.l #$4cdf7fff,$378
- move.l #$584f0257,$37c
- move.l #$7fff4e73,$380
- move.l #$bd96bdae,$384
- move.l #$42c6f,$388
- move.l #$23c17,$38c
- move.l #$246a71f,$390
- move.l #$d246d046,$394
- move.l #$b186bb86,$398
- move.l #$bd96bdae,$39c
- move.l #$4ddb9,$3a0
- move.l #$10,$3a4
- move.l #$4e730000,$3a8
- move.l #$0,$3ac
- move.l #$0,$3b0
- move.l #$70004e75,$3b4
- move.l #$3346,$3b8
- move.l #$4e754e75,$3bc
- move.l #$0,$3c0
- move.l #$222f,$3c4
- move.l #$1f,$3c8
- move.l #$8afa,$3cc
- move.l #$1724a,$3d0
- move.l #$1874e,$3d4
- move.l #$7004,$3d8
- move.l #$a3c6,$3dc
- move.l #$9e16,$3e0
- ; move.l #$21000000,$3f0
- ; move.l #$4f80010,$3f4
- move.l #$41a0000,$3fc
- rts
-
- RemoveProtect_2DTIMO:
- bsr RemoveProtect_2D_Common
-
- move.l #$1001FF00,$84c4
- move.l #$10A0000,$86d0
- move.l #$FFFFFFFE,$8AC4
- move.l #$70616e65,$9D3C
- move.l #$75578,$9d70
- move.l #$3C,$9E4C
- move.l #$FC9C0000,$9E64
- move.l #$3C,$9E78
- move.l #$3F440000,$9E94
- move.l #$1,$CDA4
- move.l #$30002,$CDA8
- move.l #$3C00020,$140B4
- move.l #$33000C,$140B8
- rts
-
- RemoveProtect_2D:
- bsr RemoveProtect_2D_Common
- move.l #$3f801001,$84c8
- move.l #$ff0000e0,$84cc
- move.l #$24010a,$86d4
- move.l #$120,$86d8
- move.l #$ffff,$8ac8
- move.l #$fffe1001,$8acc
- move.l #$1fc07061,$9d40
- move.l #$6e656c31,$9d44
- move.l #$7,$9d74
- move.l #$55780007,$9d78
- move.l #$3d,$9db0
- move.l #$3d8a0000,$9db4
- move.l #$c40000ff,$9e3c
- move.l #$6e0000,$9e54
- move.l #$a,$9e64
- move.l #$a26d,$9e68
- move.l #$6e0000,$9e80
- move.l #$3f12,$9e98
- move.l #$10003,$cdac
- move.l #$200033,$140bc
- move.l #$613c7100,$14308
- move.l #$613c7100,$14350
- move.l #$59387800,$145f4
- move.l #$59387880,$1467c
- move.l #$59407800,$14704
- move.l #$59407880,$1478c
- move.l #$59387800,$14814
- move.l #$59387880,$1489c
- move.l #$59407800,$14924
- move.l #$59407880,$149ac
- move.l #$59407880,$149ac
- rts
-
-
- ; *** Loading routine. Common to all lemmings versions
-
- DiskRoutine:
- cmp.b #5,D1
- beq DR_DirRead
- cmp.b #0,D1
- beq DR_FileRead
-
- moveq.l #0,D0
- bra DR_End
-
- ; *** load the file
-
- DR_FileRead:
- moveq.l #0,D0
- moveq.l #-1,D1
-
- JSRGEN ReadFile
- tst.l D0
- bmi DR_NotFound
-
- bsr correct_code
-
- moveq.l #0,D0
- bra DR_End
-
- ; *** read directory
-
- DR_DirRead:
- moveq.l #0,D0
- moveq.l #0,D1
- DR_End:
- MOVEM.L (A7)+,D2-D7/A0-A6
- RTS
-
- DR_NotFound:
- lea FileError(pc),A0
- JSRGEN SetExitRoutine
- JSRGEN InGameExit
- move.w #$F00,$DFF180
- bra DR_NotFound
-
- ; *** other commands, still not supported
-
- DR_Other:
- JSRGEN WaitMouse
- illegal
- bra DR_Other
-
- ; *** a bug when ripping the files of the 2D NTSC version
- ; *** zeroed the first $1000 bytes of the 'code' file
- ; *** lets correct it
-
- correct_code:
- tst.l (A1) ; first long = 0? strange...
- bne exit$
-
- STORE_REGS
-
- GETUSRADDR codename
- move.l A0,D1
- JSRGEN StrcmpAsm
- tst.l D0
- bne nothing$
-
- lea codesmpl(pc),A0
- ; *** dest buffer in A1
- move.w #$3FF,D0
-
- copy$
- move.l (A0)+,(A1)+
- dbf D0,copy$
-
- nothing$
- RESTORE_REGS
- exit$
- rts
-
-
- ; **** Remove protection (budget version)
-
- RemoveProtect_Budget:
- ; move.w #$8210,$DFF096
- ; JSR $7598.W ; protection
-
- move.l #$0,$8
- move.l #$7e54,$c
- move.l #$34c,$10
- ; move.l #$682ff9b6,$14
- move.l #$330,$24
- move.l #$8290ffc1,$60
- move.l #$fff8,$264
- move.l #$fff8,$268
- move.l #$1c4000cf,$26c
- move.l #$b0,$270
- move.l #$1498,$274
- move.l #$1914,$278
- move.l #$7a498b40,$27c
- move.l #$245,$280
- move.l #$0,$288
- move.l #$fff8,$28c
- move.l #$1c4000cf,$290
- move.l #$b0,$294
- move.l #$1498,$298
- move.l #$1914,$29c
- move.l #$1,$2a0
- move.l #$0,$2a4
- move.l #$0,$2a8
- move.l #$0,$2ac
- move.l #$0,$2b0
- move.l #$800002,$2b4
- move.l #$8290ffc1,$2b8
- move.l #$3,$2bc
- move.l #$7db2,$2c0
- move.l #$dff000,$2c4
- move.l #$2d8,$2c8
- move.l #$7d84,$2cc
- move.l #$2f3bb76e,$2d0
- move.l #$2c6f42b2,$2d4
- move.l #$79a0,$2d8
- move.l #$21000000,$2dc
- move.l #$348006c,$2e0
- move.l #$0,$2e4
- move.l #$0,$2e8
- move.l #$77,$2ec
- move.l #$77,$2f0
- move.l #$e1687,$2f4
- move.l #$8290ffc1,$2f8
- move.l #$7db6,$2fc
- move.l #$a7080000,$300
- move.l #$7a0a2024,$304
- move.l #$7a08,$308
- move.l #$2f3c9dfa,$30c
- move.l #$8290ffc1,$310
- move.l #$186b4,$314
- move.l #$a7040000,$318
- move.l #$9250,$31c
- move.l #$34c,$320
- move.l #$a7000000,$324
- move.l #$7f082024,$328
- move.l #$7f02,$32c
- move.l #$bd96bdae,$330
- move.l #$4487a,$334
- move.l #$1423df,$338
- move.l #$10,$33c
- move.l #$4dfaffee,$340
- move.l #$202e00b8,$344
- move.l #$4e7b0002,$348
- move.l #$200a6720,$34c
- move.l #$b3c86f0c,$350
- move.l #$d1c0d3c0,$354
- move.l #$23205980,$358
- move.l #$66fa6006,$35c
- move.l #$22d85980,$360
- move.l #$66fa200b,$364
- move.l #$67064299,$368
- move.l #$598066fa,$36c
- move.l #$2d4c00be,$370
- move.l #$4fee007c,$374
- move.l #$4cdf7fff,$378
- move.l #$584f0257,$37c
- move.l #$7fff4e73,$380
- move.l #$bd96bdae,$384
- move.l #$42c6f,$388
- move.l #$23c17,$38c
- move.l #$246a71f,$390
- move.l #$d246d046,$394
- move.l #$b186bb86,$398
- move.l #$bd96bdae,$39c
- move.l #$4ddb9,$3a0
- move.l #$10,$3a4
- move.l #$4e730000,$3a8
- move.l #$0,$3ac
- move.l #$0,$3b0
- move.l #$70004e75,$3b4
- move.l #$3346,$3b8
- move.l #$4e754e75,$3bc
- move.l #$0,$3c0
- move.l #$222f,$3c4
- move.l #$f,$3c8
- move.l #$8a54,$3cc
- move.l #$171a4,$3d0
- move.l #$186a8,$3d4
- move.l #$6f5e,$3d8
- move.l #$a320,$3dc
- move.l #$9d70,$3e0
- ;** move.l #$21000000,$3f0
- ;** move.l #$4f80010,$3f4
- move.l #$41a0000,$3fc ; blocker bug without this
- move.l #$1001ff00,$8424
- move.l #$10a0000,$8630
- move.l #$fffffffe,$8a24
- move.l #$70616e65,$9c9c
- move.l #$75578,$9cd0
- move.l #$c400,$9d94
- move.l #$86,$9dac
- move.l #$a0000,$9dc0
- move.l #$4f250000,$9dc4
- move.l #$86,$9dd8
- move.l #$3efa0000,$9df4
- move.l #$1,$cd04
- move.l #$30002,$cd08
- move.l #$3c00020,$14014
- move.l #$33000c,$14018
- move.l #$33000c,$14018
-
- rts
-
- copyblock:
- copy$
- move.l (A1)+,(A0)+
- cmp.l A1,A2
- bne copy$
- rts
-
-
-
- ; ** in case the user tries to run the game without having installed
- ; ** the game properly
-
- MainErr:
- Mac_printf "** File ''main'' missing or game not installed."
- Mac_printf " Please install the game properly and try again !!"
- JMPABS CloseAll
-
- VerErr:
- bsr DisplayVerText
- JMPABS CloseAll
-
- VerErr2:
- bsr DisplayVerText
- NEWLINE
- Mac_printf " Press RETURN to exit"
- JSRABS WaitReturn
- JMPABS CloseAll
-
- DisplayVerText:
- Mac_printf "** Sorry but the version you installed is not"
- Mac_printf " supported yet. Supported versions are:"
- Mac_printf " Lemmings Budget (PAL), Oh No More Lemmings (NTSC),"
- Mac_printf " Lemmings 2 Disks (PAL), Oh No More Lemmings (PAL),"
- Mac_printf " Oh No More Lemmings (PAL) V2, Lemmings 2 Disks (NTSC)"
- Mac_printf " Oh No More Lemmings (PAL) V3 !"
- rts
-
- FileError:
- Mac_printf "** At least one file is missing. Reinstall game"
- Mac_printf " Press RETURN to exit"
- JSRABS WaitReturn
- rts
-
- ; *** detects versions. Oh no PAL and NTSC not differencied here (assuming NTSC)
-
- GetVersion:
- lea mainname(pc),A0
- lea main_buf(pc),A1
- moveq.l #0,D0
- moveq.l #2,D1
- move.l #$44,D2
- JSRGEN ReadFilePartHD
- tst.l D0
- bne MainErr
-
- move.w main_buf(pc),D0
- cmp.w #$06E6,D0
- bne not_bud$
- RELOC_MOVEL #VER_BUDGET,version
- bra exit$
-
- not_bud$
- cmp.w #$0742,D0
- bne not_mor$
- RELOC_MOVEL #VER_MORE_NTSC,version
- bra exit$
-
- not_mor$
- cmp.w #$37DF,D0
- bne not_2dp$
- RELOC_MOVEL #VER_2D_PAL,version
- bra exit$
- not_2dp$
- cmp.w #$37DC,D0
- bne not_2dt$
-
- RELOC_MOVEL #VER_2D_TIMO,version
- bra exit$
-
- not_2dt$
- bra VerErr
- exit$
- rts
-
-
- trainer:
- dc.l 0
- version:
- dc.l 0
- ExtBase:
- dc.l 0
- ExtSize:
- dc.l 0
- ExtFlag:
- dc.l 0
- mainname:
- dc.b "main",0
- codename:
- dc.b "code",0
-
- cnop 0,4
- Decrunch:
- bsr DecRoutine
- STORE_REGS
- move.l #$082E000E,D0
- move.l #$082E0006,D1
- lea $7BB5A,A0
- lea $7CAE0,A1
- JSRGEN HexReplaceLong
- RESTORE_REGS
- JSRGEN FlushCachesHard
- RTS
-
- DecRoutine:
- ADDA.L D0,A0 ;00: D1C0
- MOVEA.L -(A0),A2 ;02: 2460
- ADDA.L A1,A2 ;04: D5C9
- MOVE.L -(A0),D5 ;06: 2A20
- MOVE.L -(A0),D0 ;08: 2020
- EOR.L D0,D5 ;0A: B185
- LAB_0000:
- LSR.L #1,D0 ;0C: E288
- BNE.S LAB_0001 ;0E: 6604
- BSR LAB_000E ;10: 61000084
- LAB_0001:
- BCS.S LAB_0008 ;14: 653A
- MOVEQ #8,D1 ;16: 7208
- MOVEQ #1,D3 ;18: 7601
- LSR.L #1,D0 ;1A: E288
- BNE.S LAB_0002 ;1C: 6604
- BSR LAB_000E ;1E: 61000076
- LAB_0002:
- BCS.S LAB_000A ;22: 6554
- MOVEQ #3,D1 ;24: 7203
- MOVEQ #0,D4 ;26: 7800
- LAB_0003:
- BSR LAB_000F ;28: 61000078
- MOVE D2,D3 ;2C: 3602
- ADD D4,D3 ;2E: D644
- LAB_0004:
- MOVEQ #7,D1 ;30: 7207
- LAB_0005:
- LSR.L #1,D0 ;32: E288
- BNE.S LAB_0006 ;34: 6604
- BSR LAB_000E ;36: 6100005E
- LAB_0006:
- ROXL.L #1,D2 ;3A: E392
- DBF D1,LAB_0005 ;3C: 51C9FFF4
- MOVE.B D2,-(A2) ;40: 1502
- DBF D3,LAB_0004 ;42: 51CBFFEC
- BRA LAB_000C ;46: 6000003E
- LAB_0007:
- MOVEQ #8,D1 ;4A: 7208
- MOVEQ #8,D4 ;4C: 7808
- BRA.S LAB_0003 ;4E: 60D8
- LAB_0008:
- MOVEQ #2,D1 ;50: 7202
- BSR LAB_000F ;52: 6100004E
- CMP.B #$02,D2 ;56: B43C0002
- BLT.S LAB_0009 ;5A: 6D14
- CMP.B #$03,D2 ;5C: B43C0003
- BEQ.S LAB_0007 ;60: 67E8
- MOVEQ #8,D1 ;62: 7208
- BSR LAB_000F ;64: 6100003C
- MOVE D2,D3 ;68: 3602
- MOVEQ #12,D1 ;6A: 720C
- BRA LAB_000A ;6C: 6000000A
- LAB_0009:
- MOVEQ #9,D1 ;70: 7209
- ADD D2,D1 ;72: D242
- ADDQ #2,D2 ;74: 5442
- MOVE D2,D3 ;76: 3602
- LAB_000A:
- BSR LAB_000F ;78: 61000028
- LAB_000B:
- SUBQ.L #1,A2 ;7C: 538A
- MOVE.B 0(A2,D2.W),(A2) ;7E: 14B22000
- DBF D3,LAB_000B ;82: 51CBFFF8
- LAB_000C:
- CMPA.L A2,A1 ;86: B3CA
- BLT.S LAB_0000 ;88: 6D82
- TST.L D5 ;8A: 4A85
- BNE.S LAB_000D ;8C: 6602
- RTS ;8E: 4E75
- LAB_000D:
- JSRGEN InGameExit
- bra LAB_000D
- LAB_000E:
- MOVE.L -(A0),D0 ;96: 2020
- EOR.L D0,D5 ;98: B185
- MOVE #$0010,CCR ;9A: 44FC0010
- ROXR.L #1,D0 ;9E: E290
- RTS ;A0: 4E75
- LAB_000F:
- SUBQ #1,D1 ;A2: 5341
- MOVEQ #0,D2 ;A4: 7400
- LAB_0010:
- LSR.L #1,D0 ;A6: E288
- BNE.S LAB_0011 ;A8: 660A
- MOVE.L -(A0),D0 ;AA: 2020
- EOR.L D0,D5 ;AC: B185
- MOVE #$0010,CCR ;AE: 44FC0010
- ROXR.L #1,D0 ;B2: E290
- LAB_0011:
- ROXL.L #1,D2 ;B4: E392
- DBF D1,LAB_0010 ;B6: 51C9FFEE
- RTS ;BA: 4E75
-
- codesmpl:
- incbin "codesmpl.bin"
-
- cnop 0,4
- main_buf:
- dc.l 0,0
-